package com.gmt;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author John.zhang
 * @version Id: ConfigController, v 1.0 2020/11/19 15:21 ZhiYong Exp $
 */

@RefreshScope
@RestController
public class ConfigController {

    @Value("${common.config}")
    private String config;

    @Value("${username}")
    private String username;

    @GetMapping("/config")
    public String getConfig(){
        return config;
    }


    @GetMapping("/dynamicConfig")
    public String getDynamicConfig(){
        return username;
    }

}
